package com.example.common;


import com.example.JunitDemoApplication;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.ConfigurableEnvironment;

import java.io.IOException;

@Slf4j
@ImportAutoConfiguration(classes = {TestAutoConfig.class})
@SpringBootTest(classes = JunitDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class BaseMain {


    @Resource
    private ConfigurableEnvironment environment;

    @Test
    public void run() throws IOException {

        if (EnvUtils.isLocal(environment.getActiveProfiles())) {
            System.in.read();
        }

        log.info("**********************************BaseMain stg no run **********************************");
    }
}
